// 模拟Excel解析后的结构（含合并单元格、固定文本）
export const mockExcelParseResult = {
  templateId: 'TPL_20251111_001',
  startRow: 1,
  endRow: 6,
  startCol: 1,
  endCol: 8,
  cells: [
    // 表头行
    { row: 1, col: 1, value: '参数组1', isEmpty: false, address: 'A1' },
    { row: 1, col: 2, value: '', isEmpty: true, address: 'B1' },
    { row: 1, col: 3, value: '', isEmpty: true, address: 'C1' },
    { row: 1, col: 4, value: '参数组2', isEmpty: false, address: 'D1' },
    { row: 1, col: 5, value: '', isEmpty: true, address: 'E1' },
    { row: 1, col: 6, value: '', isEmpty: true, address: 'F1' },
    { row: 1, col: 7, value: '', isEmpty: true, address: 'G1' },
    { row: 1, col: 8, value: '', isEmpty: true, address: 'H1' },
    // 二级表头
    { row: 2, col: 1, value: '新参数1', isEmpty: false, address: 'A2' },
    { row: 2, col: 2, value: '新参数2', isEmpty: false, address: 'B2' },
    { row: 2, col: 3, value: '新参数（kp）', isEmpty: false, address: 'C2' },
    { row: 2, col: 4, value: '子组1', isEmpty: false, address: 'D2' },
    { row: 2, col: 5, value: '', isEmpty: true, address: 'E2' },
    { row: 2, col: 6, value: '子组2', isEmpty: false, address: 'F2' },
    { row: 2, col: 7, value: '', isEmpty: true, address: 'G2' },
    { row: 2, col: 8, value: '参数组3（动态行）', isEmpty: false, address: 'H2' },
    // 三级表头
    { row: 3, col: 1, value: '', isEmpty: true, address: 'A3' },
    { row: 3, col: 2, value: '', isEmpty: true, address: 'B3' },
    { row: 3, col: 3, value: '', isEmpty: true, address: 'C3' },
    { row: 3, col: 4, value: '新参数3', isEmpty: false, address: 'D3' },
    { row: 3, col: 5, value: '新参数4', isEmpty: false, address: 'E3' },
    { row: 3, col: 6, value: '新参数5', isEmpty: false, address: 'F3' },
    { row: 3, col: 7, value: '新参数6', isEmpty: false, address: 'G3' },
    { row: 3, col: 8, value: '', isEmpty: true, address: 'H3' },
    // 数据行
    { row: 4, col: 1, value: '', isEmpty: true, address: 'A4' },
    { row: 4, col: 2, value: '', isEmpty: true, address: 'B4' },
    { row: 4, col: 3, value: '', isEmpty: true, address: 'C4' },
    { row: 4, col: 4, value: '', isEmpty: true, address: 'D4' },
    { row: 4, col: 5, value: '', isEmpty: true, address: 'E4' },
    { row: 4, col: 6, value: '', isEmpty: true, address: 'F4' },
    { row: 4, col: 7, value: '', isEmpty: true, address: 'G4' },
    { row: 4, col: 8, value: '', isEmpty: true, address: 'H4' },
    // 签字栏行
    { row: 6, col: 1, value: '检测员签字：', isEmpty: false, address: 'A6' },
    { row: 6, col: 2, value: '', isEmpty: true, address: 'B6' },
    { row: 6, col: 3, value: '审核员签字：', isEmpty: false, address: 'C6' },
    { row: 6, col: 4, value: '', isEmpty: true, address: 'D6' },
    { row: 6, col: 5, value: '日期：', isEmpty: false, address: 'E6' },
    { row: 6, col: 6, value: '', isEmpty: true, address: 'F6' },
    { row: 6, col: 7, value: '报告编号：', isEmpty: false, address: 'G6' },
    { row: 6, col: 8, value: '', isEmpty: true, address: 'H6' }
  ],
  merges: [
    // 合并单元格规则：row=行号，col=列号，rowspan=合并行数，colspan=合并列数
    { row: 1, col: 1, rowspan: 1, colspan: 3 }, // 参数组1合并3列
    { row: 1, col: 4, rowspan: 1, colspan: 4 }, // 参数组2合并4列
    { row: 2, col: 4, rowspan: 1, colspan: 2 }, // 子组1合并2列
    { row: 2, col: 6, rowspan: 1, colspan: 2 }, // 子组2合并2列
    { row: 2, col: 8, rowspan: 2, colspan: 1 }, // 参数组3合并2行
    { row: 6, col: 1, rowspan: 1, colspan: 1 }, // 检测员签字
    { row: 6, col: 2, rowspan: 1, colspan: 1 }, // 检测员签字框
    { row: 6, col: 3, rowspan: 1, colspan: 1 }, // 审核员签字
    { row: 6, col: 4, rowspan: 1, colspan: 1 }, // 审核员签字框
    { row: 6, col: 5, rowspan: 1, colspan: 1 }, // 日期
    { row: 6, col: 6, rowspan: 1, colspan: 1 }, // 日期框
    { row: 6, col: 7, rowspan: 1, colspan: 1 }, // 报告编号
    { row: 6, col: 8, rowspan: 1, colspan: 1 }  // 报告编号框
  ]
};

// 模拟接口：上传Excel并返回解析结果
export const uploadExcel = () => {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve({
        code: 200,
        data: mockExcelParseResult
      });
    }, 1000);
  });
};